package com.boge.modules.house.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.boge.common.utils.PageUtils;
import com.boge.common.utils.Query;

import com.boge.modules.house.dao.TCityDao;
import com.boge.modules.house.entity.TCityEntity;
import com.boge.modules.house.service.TCityService;


@Service("tCityService")
public class TCityServiceImpl extends ServiceImpl<TCityDao, TCityEntity> implements TCityService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TCityEntity> page = this.page(
                new Query<TCityEntity>().getPage(params),
                new QueryWrapper<TCityEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<TCityEntity> listByProvinceCode(String provinceCode) {
        List<TCityEntity> list = this.list(new LambdaQueryWrapper<TCityEntity>().eq(TCityEntity::getProvinceCode, provinceCode));
        return list;
    }

}